package com.isp.common.utils;

import org.slf4j.helpers.MessageFormatter;

/**
 * @author Linsy
 * @version 1.0
 * @created 2024/7/21.
 */
public class StringSpliceUtils {

    /**
     * 字符串拼接.
     * eg:
     * StringSpliceUtils.splice("主键为:{}",123) = "主键为:123"
     *
     * @param pattern 拼接模板
     * @param arr     待拼接内容
     * @return 拼接结果
     */
    public static String splice(String pattern, Object... arr) {
        return MessageFormatter.arrayFormat(pattern, arr).getMessage();
    }
}
